<?php

namespace app\admin\validate;

use think\Validate;

class ArticleCategory extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */	
	protected $rule = [
	    'name'=>'require|unique:ArticleCategory|token',
        'describe'=>'require'
    ];
    
    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */	
    protected $message = [
        'name.require' => '名称必须填写',
        'name.unique'  =>'名称已经存在',
        'describe.require' =>'描述不能为空'
    ];
    protected $scene = [
        'add'=>['name','describe'],
        'edit'=>['name','describe']
    ];
}
